View::PasteData
Section: ET++ method description (n)
Updated: automatically Mon Apr 8 20:17:22 1991
Index
Return to Main Contents
NAME
View::PasteData - instance method
TEMPLATE
pasteCommand = Command *
PasteData(char * type, istream & inputStream)
SPECIFIERS
public
abstract
virtual
DESCRIPTION
PasteData is called when the paste command is selected from the popup menu. But this menu item is only enabled if the method CanPaste returns TRUE.
PasteData must read the clipboard data from the inputStream and create an undoable pasteCommand to insert the read data into the data structure of this. If nothing is read or the clipboard data cannot be pasted, then gNoChanges must be returned.
For example, a subclass of View that expects objects of a certain class would implement PasteData like this:
Command *MyView::PasteData (char *type, istream& is)
{
if (strcmp(type, cDocTypeET) == 0)
{
Object *pastedObject = NULL;
is >> pastedObject;
if (pastedObject && pastedObject->IsKindOf(MyDesiredClass))
return new MyPasteCommand (pastedObject);
}
return gNoChanges;
}
A concrete example can be found in the method TextView::PasteData.
See also method SelectionToClipboard.
Method is sometimes overridden.
ARGUMENTS
- char * type
-
is the type of the clipboard data contained in the inputStream. Common types are cDocTypeET which indicates ET++ Object Input/Output format and cDocTypeAscii for pure ASCII text.
- istream & inputStream
-
a stream created by the clipboard from which the clipboard data can be read
RETURN ARGUMENT
- Command * pasteCommand
-
is either gNoChanges or an undoable command object which actually pastes the data into this
CATEGORIES
clipboard, overrider interface
FIRST DEFINITION
class View
FILES
- implementation:
-
View.C
Index
- NAME
-
- TEMPLATE
-
- SPECIFIERS
-
- DESCRIPTION
-
- ARGUMENTS
-
- RETURN ARGUMENT
-
- CATEGORIES
-
- FIRST DEFINITION
-
- FILES
-
This document was created by
man2html,
using the manual pages.
Time: 00:40:20 GMT, March 30, 2022